from flask import Flask, request
from flask_cors import CORS
from API.hf_api import hf
from API.other_api import other


def create_app():
    app = Flask(__name__)
    # 注册蓝图,url_prefix为访问前缀
    app.register_blueprint(blueprint=hf, url_prefix='/hf')
    app.register_blueprint(blueprint=other, url_prefix='/other')

    # 跨域配置
    CORS(app, resources=[r'/*'])
    return app

